<template>


<el-button @click="get_card">
        发牌
</el-button>
    
    


</template>

<script>
import axios from 'axios'
export default {
  name: 'gameroom',

data(){
	return{msg:''};
},
methods:{
    get_card:function(){             
        //定义请求路径
        let url='/api/getcard';
        //定义请求参数
        let params={
            methodName:'getcard',
        };
        let headers={
            token:sessionStorage.getItem('accessToken')
        }
        
        //发起ajax请求GET
        axios.get(url,{params:params,headers:headers}).then(resp=>{
            let data=resp.data;
            this.$message({
                message: data.mess,
                type: data.code==1?'success':'error'
            });
            if(data.code==1){
                alert(data.card);
            }
        }).catch(err=>{
            console.log(err);
        });
        },
    }
}

</script>


<style></style>